﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Reflection;
using Unleashed.AutoUpdate.IO;

namespace Unleashed.AutoUpdate.Common.Test
{
    [TestClass]
    public class FileTest
    {
        [TestMethod, DeploymentItem("Data//File1.txt"), DeploymentItem("Data//File2.txt")]
        public void Checksum()
        {
            string path1 = "File1.txt";
            string path2 = "File2.txt";

            string hash1 = File.ChecksumSha1(path1);
            string hash1rep = File.ChecksumSha1(path1);

            string hash2 = File.ChecksumSha1(path2);
            string hash2rep = File.ChecksumSha1(path2);

            Assert.AreEqual<string>(hash1, hash1rep);
            Assert.AreEqual<string>(hash2, hash2rep);
            Assert.AreNotEqual<string>(hash1, hash2);
            Assert.AreNotEqual<string>(hash1rep, hash2);
        }
    }
}